import { ref } from 'vue';
import * as Type from '@/api/assetManagement/resourceProject_type';

export const handlerData = ref<Type.TResourceItem>();
export const Rules = {
  name: [
    { required: true, message: '请输入资源名称', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  code: [
    { required: true, message: '请输入项目编号', trigger: 'blur' },
    { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' }
  ],
  manager: [{ required: true, message: '请输入项目经理', trigger: 'blur' }],

  status: [{ required: true, message: '请选择项目进度', trigger: 'blur' }],
  dateRange: [{ required: true, message: '请选择起始日期', trigger: 'blur' }],

  budget: [
    { required: true, message: '请输入项目预算', trigger: 'blur' },
    { pattern: /^[0-9|^\\.]/, message: '输入不能为负数' }
  ],
  actual: [
    { required: true, message: '请输入实际花费', trigger: 'blur' },
    { pattern: /^[0-9|^\\.]/, message: '输入不能为负数' }
  ]
};

export function CreateColumnData() {
  return {
    id: '',
    affiliation: '', // 所属部门
    job_number: '', // 工号
    name: '', // 姓名
    office: '', // 职务
    qualifications: '' // 学历
  };
}
export const Columns = [
  { title: '序号', dataIndex: 'index', slotName: 'index' },
  { title: '姓名', dataIndex: 'name', slotName: 'name' },
  { title: '工号', dataIndex: 'job_number', slotName: 'job_number' },
  { title: '所属部门', dataIndex: 'affiliation', slotName: 'affiliation' },
  { title: '职业', dataIndex: 'office', slotName: 'office' },
  { title: '学历', dataIndex: 'qualifications', slotName: 'qualifications' },
  { title: '操作', dataIndex: 'operator', slotName: 'operator' }
];
